PUBLIC = ../../public
SRC = src
BIN = bin
GLOBAL_BIN = ../../bin
CFLAGS = -Wall -pedantic -ansi -Werror
CC = gcc
LIB_TOOL = ar
LIB_FLAGS = -r -s
COMPILE_FLAG = -c

all: release 

debug: CFLAGS+=-g 
debug: BIN=bin/debug
debug: GLOBAL_BIN=../../bin/debug
debug: $(BIN)/TreeTest clean
	@echo "**********************************************************"
	@echo "*							*"
	@echo "*		SUCCEFULY FINISHED			*"
	@echo "*							*"
	@echo "**********************************************************"


release: CFLAGS+=-DNDEBUG
release: BIN=bin/release
release: GLOBAL_BIN=../../bin/release
release: $(BIN)/TreeTest clean
	@echo "**********************************************************"
	@echo "*							*"
	@echo "*		SUCCEFULY FINISHED			*"
	@echo "*							*"
	@echo "**********************************************************"

$(BIN)/TreeTest: TreeTest.o
	$(CC) $(CFLAGS) TreeTest.o -L$(GLOBAL_BIN) -lTree -o $(BIN)/TreeTest

TreeTest.o: $(PUBLIC)/Tree.h TreeTest.c
	$(CC) $(COMPILE_FLAG) $(CFLAGS) -I$(PUBLIC) TreeTest.c -o TreeTest.o

clean: 
	rm *.o
